<?php

namespace Yz\modules\Generic;

class Template_Neighbors
    extends \Yz_Template_Native
{

    protected $itemName;
    protected $modelName = "Default";

    protected function doRender()
    {
        $v =& $this->value;
        if (array_key_exists('item', $v)) {
            $item = $v['item'];

            // fetch item's prev/next
            list ($prev, $next) = $item->fetchNeighbors();

            $v['prevItem'] = $prev;
            $v['nextItem'] = $next;

        }
        return parent::doRender();
    }

}
